﻿#if NETSTANDARD2_1
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;

namespace T.FAS.Runtime.ScheduleJob.Service
{
    public class ScheduleJobServiceMiddleware
    {
        private readonly RequestDelegate _next;
        public ScheduleJobServiceMiddleware(RequestDelegate next)
        {
            _next = next;
        }

        public async Task Invoke(Microsoft.AspNetCore.Http.HttpContext context)
        {
            ScheduleJobGlobalService.GetInstance().Start();
            await _next.Invoke(context);
        }
    }
}
#endif